package com.example.shushiyunsst.util.flutter_bridgt

import io.flutter.plugin.common.EventChannel

class EventChannelManager private constructor() {

    companion object {
        @JvmStatic
        @get:Synchronized
        var instance: EventChannelManager? = null
            get() {
                if (field == null) field = EventChannelManager()
                return field
            }
            private set

    }

    private var mEventChannelMap = mutableMapOf<String, EventChannelPlugin?>()

    fun putEventChannel(name: String, mEvent: EventChannelPlugin?) {
        mEventChannelMap[name] = mEvent
    }

    fun getEventChannel(name: String) = mEventChannelMap[name]

}